package com.example.springbootkafkademo.controller;

import com.example.springbootkafkademo.mq.KafkaProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhl
 * @Title: KafkaController
 * @Description TODO
 * @date： 2022/1/28 17:12
 * @version： V1.0
 */
@RestController
public class KafkaController {

    @Autowired
    private KafkaProducer kafkaProducer;

    @GetMapping("/send")
    public void sendMsg(){
        kafkaProducer.send("------------测试消息-----------");
    }
}
